package kr.cafedev.hangul;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DatabaseHelper extends SQLiteOpenHelper {

	//private static final String DATABASE_URL ="http://nicejin78.googlecode.com/files/mDB.db";
	private static final String DATABASE_NAME = "base.db";
	private static final String TABLE_NAME = "mTable";
	private static final int DATABASE_VERSION = 1;

	private static final String TAG = "DatabaseHelper";
	
	public DatabaseHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
		
	}
	
	public void onCreate(SQLiteDatabase db) {
		
		
		
		
		Log.e(TAG, "onCreate");
//		db.execSQL("CREATE TABLE "+TABLE_NAME + " ( _id INTEGER PRIMARY KEY , " +
//		"name TEXT, kind TEXT, menu TEXT, note TEXT, phone TEXT, city TEXT, address TEXT, url TEXT, gps TEXT," +
//		"image01 TEXT, image02 TEXT, image03 TEXT, desc TEXT, favoriate NUMERIC);"
//				);
//		db.execSQL("CREATE TABLE "+VERSION_TABLE + " ( _id INTEGER PRIMARY KEY , " +"version NUMERIC);");
//		db.execSQL("INSERT INTO "+ VERSION_TABLE + " values(1,1);");//set version to 1
		

	}


	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		Log.e(TAG, "onUpgrade");
//		db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
//		db.execSQL("DROP TABLE IF EXISTS " + VERSION_TABLE);
		onCreate(db);
	}


}
